import dash
from dash import html, dcc, Output, Input
import feffery_antd_components as fac
import time

app = dash.Dash(__name__)

app.layout = html.Div(
    [
        fac.AntdSpin(
            fac.AntdButton(
                '开始查询',
                id='process-button-demo'
            ),
            text='回调中...',
        )
    ]
)

@app.callback(
    Output('process-button-demo', 'disabled'),
    Input('process-button-demo', 'nClicks')
)
def process_callback(nClicks):
    if nClicks:
        time.sleep(2)
    return dash.no_update


if __name__ == '__main__':
    app.run_server(debug=True)
